package com.perceptivesoftware.licensing.client.rpc;

import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.perceptivesoftware.licensing.client.common.util.PerceptivePermission;
import com.perceptivesoftware.licensing.client.dialogs.useradmin.plugin.role.RoleDTO;
import com.perceptivesoftware.licensing.client.dialogs.useradmin.plugin.role.RoleNavItem;
import com.perceptivesoftware.licensing.client.dialogs.useradmin.plugin.user.PermissionsSaveDTO;
import com.perceptivesoftware.licensing.client.dialogs.useradmin.plugin.user.UserDTO;
import com.perceptivesoftware.licensing.client.dialogs.useradmin.plugin.user.UserNavItem;
import com.perceptivesoftware.licensing.client.dto.SecurityTreeDTO;

public interface SecurityServiceAsync {

	public void createRole(String name, AsyncCallback<RoleNavItem> asyncCallback);

	public void createUser(String name, String roleCode, Boolean isSuper, AsyncCallback<UserNavItem> asyncCallback);

	public void deleteRole(String roleCode, AsyncCallback<String> asyncCallback);

	public void deleteUser(String userCode, AsyncCallback<String> asyncCallback);

	public void getRoleDTO(String roleCode, AsyncCallback<RoleDTO> asyncCallback);

	public void getUserDTO(String userCode, AsyncCallback<UserDTO> asyncCallback);

	public void renameRole(String roleCode, String name, AsyncCallback<String> asyncCallback);

	public void saveUserSettings(UserDTO user, AsyncCallback<UserDTO> asyncCallback);

	public void saveUserPermissions(String userCode, List<PerceptivePermission> dirtyPermissions, AsyncCallback<PermissionsSaveDTO> asyncCallback);

	public void saveRolePermissions(String roleCode, List<PerceptivePermission> dirtyPermissions, AsyncCallback<PermissionsSaveDTO> asyncCallback);

	public void saveRolePermissions(String roleCode, List<PerceptivePermission> dirtyPermissions, List<PerceptivePermission> cascadePermissions,
			AsyncCallback<PermissionsSaveDTO> asyncCallback);

	public void saveUserConfig(String userCode, UserDTO userDTO, AsyncCallback<Void> callback);

	public void getSecurityTreeDTO(String roleValCode, AsyncCallback<SecurityTreeDTO> securityManagerAsyncCallback);
}